#ifndef USART_H
#define USART_H 

#include "stm32f10x.h"
#include <stdio.h>

#define  USARTx                      USART1
#define  USART_CLK                   RCC_APB2Periph_USART1
#define  USART_APBxCLKCmd            RCC_APB2PeriphClockCmd
#define  USART_BAUDRATE              115200


#define  USART_GPIO_CLK              (RCC_APB2Periph_GPIOA)
#define  USART_GPIO_APBxCLKCmd       RCC_APB2PeriphClockCmd


#define  USART_TX_GPIO_PORT          GPIOA
#define  USART_TX_GPIO_PIN           GPIO_Pin_9
#define  USART_RX_GPIO_PORT          GPIOA
#define  USART_RX_GPIO_PIN           GPIO_Pin_10


#define  USART_IRQ                   USART1_IRQn
#define  USART_IRQHandler            USART1_IRQHandler


void USART_Config(void);
void Usart_SendByte( USART_TypeDef * pUSARTx, uint8_t ch);
void Usart_SendString( USART_TypeDef * pUSARTx, char *str);
void Usart_SendHalfWord( USART_TypeDef * pUSARTx, uint16_t ch);
#endif /*USART_H*/

